package com.cskaoyan.demo;

import com.cskaoyan.utils.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ColumnListHandler;

import java.sql.SQLException;
import java.util.List;

// columnListHandler
public class QueryRunnerDemo4 {

    public static void main(String[] args) throws SQLException {

        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());

        List<String> nameList = queryRunner.query("select name from account where id > ? and money > ?", new ColumnListHandler<>(), 1, 100);

        System.out.println(nameList);
    }

}
